import sympy as sym
import numpy as np
from sympy import sin,cos,Function
sym.init_printing()
#document:https://github.com/sympy/sympy


def rdivide(arg_a, arg_b, flag = True):
    if flag :
        return sym.simplify(np.asarray(arg_a) / np.asarray(arg_b))
    else:
        return np.asarray(arg_a) / np.asarray(arg_b)
    
x = sym.symbols('x')
y = sym.symbols('y')
A = [x,sin(x),11/6]
B = [[x, x, x],[y, x**2, x]]
f, g = sym.symbols('f,g', cls=Function)
f = x**2+ 3*x + 2
g = 3*x - 1

res = rdivide(x, y)
res1 = rdivide(x, A)
res2 = rdivide(B, x)
res3 = rdivide(f, g)
res4 = rdivide(A, B)
res5 = rdivide(f, x)
print(res)
print(res1)
print(res2)
print(res3)
print(res4)
print(res5)
print(A)

C = [x,sin(x),3]
D = [x, x**2, x]
c1 = np.asarray(C)


